package ontology;

public enum Direction implements Compare{
	
	FORWARD,
	BACKWARD,
	NULL;

	public static Direction getDirection(String attributeValue) {
		if(attributeValue.equalsIgnoreCase(Direction.FORWARD.toString())){
			return Direction.FORWARD;
		} else if(attributeValue.equalsIgnoreCase(Direction.BACKWARD.toString())){
			return Direction.BACKWARD;
		} else {
			return Direction.NULL;
		}
	}

	public Comparison compareWith(Object other) {
		if(this.equals(other)){
			return Comparison.ALL_SAME;
		} else if(this.equals(NULL) || other.equals(NULL)){
			return Comparison.DIFFERENT_NON_OPPOSING;
		}
		return Comparison.HAS_OPPOSING;
	}

}
